package com.wdzl.dao;

import com.wdzl.dao.BaseDao;
import com.wdzl.entity.Depart;

import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;

/**
 * 部门数据访问层
 */
public class DeptDao extends BaseDao {
    public List<Depart> getDeaprts(){
        String sql="select id,name from DepartInfo";
        return super.query(sql,Depart.class);
    }

    public int getDid(String dname){
        String sql = "select id,name from departInfo where name=?";
        return super.queryOne(sql,Depart.class,dname).getId();
    }
}
